import pool from "@/lib/db";

const permissionModule = {
  getById: async (id) => {
    const sql = 'SELECT * FROM permissions WHERE id = ?';
    const [rows] = await pool.query(sql, [id]);
    return rows[0];
  },
  getAll: async () => {
    const sql = 'SELECT * FROM permissions';
    const [rows] = await pool.query(sql);
    return rows;
  }
}

export default permissionModule;